package com.ziytek.web.citizen.enums;

import com.ziytek.web.citizen.service.itf.StepAddResponse;
import lombok.Getter;

/**
 * @author fenghx
 * @version 1.0
 * @className StepTypeNoEnum
 * Description:
 * @date 2024/3/15 13:24
 */
@Getter
public enum StepTypeNoEnum implements StepAddResponse {
    /**
     * Description: 工步类型信息
     */

    STEP_TYPE_CCC_NUM("cccv", "01"),
    STEP_TYPE_CC_NUM("cc", "02"),
    STEP_TYPE_CV_NUM("cv", "03"),
    STEP_TYPE_CCD_NUM("ccd", "04"),
    STEP_TYPE_SL_NUM("sl", "00"),
    STEP_TYPE_CPC_NUM("cpc", "05"),
    STEP_TYPE_CPD_NUM("cpd", "06"),
    STEP_TYPE_CRD_NUM("crd", "07"),
    WAITING("waiting", "100"),
    STOP("stop", "101"),


    // 充放电类型
    //1.恒流恒压充
    //2.恒流充
    //3.恒压充
    //4.恒流放
    //5.恒功率充
    //6.恒功率放
    //7.恒阻放
    STEP_TYPE_CCC("01", "恒流恒压充"),
    STEP_TYPE_CC("02", "恒流充"),
    STEP_TYPE_CV("03", "恒压充"),
    STEP_TYPE_CCD("04", "恒流放"),
    STEP_TYPE_CPC("05", "恒功率充"),
    STEP_TYPE_CPD("06", "恒功率放"),
    STEP_TYPE_CRD("07", "恒阻放"),


    OTHER("00", "其他");

    private final String code;
    private final String desc;

    StepTypeNoEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    @Override
    public String getMsg(String code) {
        for (StepTypeNoEnum sp : StepTypeNoEnum.values()) {
            if (sp.getCode().equalsIgnoreCase(code)) {
                return sp.desc;
            }
        }
        return STEP_TYPE_SL_NUM.getDesc();
    }

    @Override
    public int getPosition(String code) {
        return 0;
    }

    @Override
    public String getCode(String line, int position) {
        return null;
    }
}
